package com.neuedu.his.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.neuedu.his.po.Register;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

/**
 * @author root
 * @description 针对表【register】的数据库操作Mapper
 * @createDate 2025-06-25 10:55:54
 * @Entity com.neuedu.his.po.Register
 */
public interface RegisterMapper extends BaseMapper<Register> {
    @Select({
            "<script>",
            "SELECT * FROM Register WHERE UserID = #{doctorId} AND VisitState IN ",
            "<foreach item='item' index='index' collection='visitStates' open='(' separator=',' close=')'>",
            "#{item}",
            "</foreach>",
            "</script>"
    })
    List<Register> findByDoctorAndVisitStates(@Param("doctorId") Integer doctorId, @Param("visitStates") List<Integer> visitStates);


    @Select({
            "<script>",
            "SELECT * FROM Register WHERE DeptID = #{deptId} AND VisitState IN ",
            "<foreach item='item' index='index' collection='visitStates' open='(' separator=',' close=')'>",
            "#{item}",
            "</foreach>",
            "</script>"
    })
    List<Register> findByDeptAndVisitStates(@Param("deptId") Integer deptId, @Param("visitStates") List<Integer> visitStates);

}





